use v5.14;
use Parallel::Jobs;

#==============================================================================
#
# Name: Event-Handler-Script-1.pl
#
# Written by: Samuel Barton
#
# Date: May 23, 2014
#
# Project: Manager Scripts
#
# Description: This program will manage the scripts which interface with and
#              get information from event-based devices.
#
#==============================================================================

# - The path to the list of currently connected devices
$connected_dev_path = "DEVICES.txt";
# - The path to the list of supported devices
$supported_dev_path = "EVENT_DEV.txt";
# - The hash of devices with scripts currently pulling data from them
%running_dev;
# - The reference to Event_dev_log.pl (here so it can be killed if %running_dev
#   length is 0.
$logging_process;
# - Flag to tell whether or not to launch Event_dev_log.pl
$first_dev_launched = 1;

# infinite loop

    # get data from $connected_dev_path

    # determine if the device has a script currently running for it

    # determine if the device is is supported

    # If the device does not have a script running for it, and is supported,
    # then start the script for the device using Parallel::Jobs.

        # if this was the first device to have a script started for it, then
        # start Event_dev_log.pl using Parallel::Jobs so that if all event 
        # interface processes are killed it can be as well.

    # If there are no processes currently running, kill Event_dev_log.pl and 
    # set first_dev_launched back to 1.
